package lock_condition;

class Receiver extends Thread{
int id;
BufferLimitato<Integer> bl;
public Receiver( int id, BufferLimitato<Integer> bl ){
this.id=id; this.bl=bl;
}
public void run(){
while( true ){
int x=((Integer)bl.get()).intValue(); //oppure: int x=bl.get(); //auto-unboxing
System.out.println("Receiver#"+id+" legge messaggio# "+x);
}
}}
